package com.rmb.mart.entity.api;

import com.rmb.common.validated.RecordQueryGroup;
import com.rmb.common.validated.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.rmb.mart.qurey.QueryPage;

import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * (MartApiRecord)实体类
 *
 * @author makejava
 * @since 2021-01-20 19:21:19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MartApiRecord extends QueryPage implements Serializable{
    private static final long serialVersionUID = -74371827458161373L;


    private Integer id;
    /**
     * 公司名称
     */
    private String name;
    /**
     * 接口ID
     */
    @NotNull(message = "查询必须指定ApiID",groups = {RecordQueryGroup.class})
    private Long martApiEssentialId;
    /**
     * 使用时间
     */
    private Date useTime;
    /**
     * 接口响应时间（毫秒）
     */
    private Long responseTime;
    /**
     * 返回状态 0 失败 1 正常
     */
    private Long returnState;
    /**
     * 失败返回原因
     */
    private String failCause;
    /**
     * 创建人
     */
    private String createBy;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 修改人
     */
    private String updateBy;
    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 用户id
     */
    private Integer userInfoId;

    /**
     * 成功次数
     */
    @Transient
    private Integer trueNum;
    /**
     * 失败次数
     */
    @Transient
    private Integer falseNum;
    /**
     * 接口平均响应时间
     */
    @Transient
    private Integer averageResponseTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getMartApiEssentialId() {
        return martApiEssentialId;
    }

    public void setMartApiEssentialId(Long martApiEssentialId) {
        this.martApiEssentialId = martApiEssentialId;
    }

    public Date getUseTime() {
        return useTime;
    }

    public void setUseTime(Date useTime) {
        this.useTime = useTime;
    }

    public Long getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(Long responseTime) {
        this.responseTime = responseTime;
    }

    public Long getReturnState() {
        return returnState;
    }

    public void setReturnState(Long returnState) {
        this.returnState = returnState;
    }

    public String getFailCause() {
        return failCause;
    }

    public void setFailCause(String failCause) {
        this.failCause = failCause;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getUserInfoId() {
        return userInfoId;
    }

    public void setUserInfoId(Integer userInfoId) {
        this.userInfoId = userInfoId;
    }

    public Integer getTrueNum() {
        return trueNum;
    }

    public void setTrueNum(Integer trueNum) {
        this.trueNum = trueNum;
    }

    public Integer getFalseNum() {
        return falseNum;
    }

    public void setFalseNum(Integer falseNum) {
        this.falseNum = falseNum;
    }

    public Integer getAverageResponseTime() {
        return averageResponseTime;
    }

    public void setAverageResponseTime(Integer averageResponseTime) {
        this.averageResponseTime = averageResponseTime;
    }
}